package com.lhs.Controller;

import com.lhs.Result.Result;
import com.lhs.entity.blog.blog_cover;
import com.lhs.service.blog_coverService;
import jakarta.websocket.server.PathParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/blog/blog_cover")
public class blog_coverController {
    @Autowired
    private blog_coverService  blogCoverService;

      @GetMapping("/getBlogCover/{postId}")
    public Result<blog_cover> getBlogCover(@PathVariable("postId") Long postId) {
        if (postId == null || postId <= 0) {
            return Result.error("Invalid postId");
        }
        return blogCoverService.getBlogCover(postId);
    }

}
